package net.stogi.unicore.beyond.io.input.core.impl;

import java.util.HashMap;
import java.util.Map;

import net.stogi.unicore.beyond.api.model.InputType;
import net.stogi.unicore.beyond.io.input.core.InputValidator;
import net.stogi.unicore.beyond.io.input.core.InputValidatorRegistry;

public class InputValidatorRegistryImpl implements InputValidatorRegistry {

	private Map<String, InputValidator> registry;
	
	public InputValidatorRegistryImpl() {
		registry = new HashMap<String, InputValidator>();
	}
	
	public InputValidatorRegistryImpl(Map<String, InputValidator> validators) {
		this();
		registry.putAll(validators);
	}
	
	@Override
	public InputValidator findInputValidator(InputType inputType) {
		return registry.get(inputType.getName());
	}
}
